package com.xingkeduo.pojo.dto.Shops;

import com.xingkeduo.pojo.table.ShopsServprodTable;
import com.xingkeduo.tool.AmountUtils;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * 文件概述
 *
 * @author wangxilong <wangxilong@xingkeduo.com>
 * @version id:v0.1 18-12-30 下午9:33
 * @package BeautyOS
 * @copyright Copyright (c) XKD 2019
 */
@Data
public class ShopsServprodDTO {

    private Long shopsId;
    private String code;
    private Long servprodId;

    private String servprodName;
    private Integer servtime = 20;

    private String price;

    private Boolean checked = false;

    public static ShopsServprodDTO covert(ShopsServprodTable shopsServprodTable) throws Exception{
        ShopsServprodDTO shopsServprodDTO = new ShopsServprodDTO();
        BeanUtils.copyProperties(shopsServprodTable,shopsServprodDTO);
        shopsServprodDTO.setPrice(AmountUtils.changeF2Y(shopsServprodTable.getPrice()));

        return shopsServprodDTO;
    }

}
